#include "../process.h"
#include "../tread.h"

#include <stdio.h>
#include <stdlib.h>

int clock;

int main(int argc, char **argv)
{
	int t;
	struct process *proc;

	tread_init();

	clock = 0;
	while (!tread_done())
	{
		proc = tread_next();
		if (proc!=NULL)
		{
			t = tread_time_to_event();

			proc_print(proc);

			clock = t;
		}
		proc_exit(proc);
	}
	return 0;
}

int sim_get_clock()
{
	return clock;
}
